<?php
//
ob_start();
session_start();
include "checksession.php";
$id_member = $_SESSION["id_member"];
include_once ("../connect.php");

$strSQL = "SELECT *, comname.* FROM comname LEFT JOIN depart ON comname.de_id = depart.id                                                                                
                                            LEFT JOIN employee ON comname.emp_id = employee.emp_id  
                                            LEFT JOIN mail ON comname.emp_id = mail.emp_id
                                            WHERE comname.emp_id = '$id_member'
                                            ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>

<script language="javascript">
             function CheckValidate()
            {
                if (eval("document.frmMain.txtError.value") == "") {
                    alert("กรุณากรอกช่อง รายละเอียดการซ่อม");
                    eval("document.frmMain.txtError.focus();")
                    return false;
                }
            }
</script>
  <link type="text/css" href="../css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
        <script src="../js/jquery/jquery-1.4.3.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="../js/jquery/jquery-ui-1.7.2.custom.min.js"></script>
        <script type="text/javascript" src="../js/jquery/timepicker.js"></script>
      <!--<script src="../js/jquery/ui/jquery-ui.js"></script>-->
        <script type="text/javascript">
            $(function() {
                $('#datetime').datepicker({
                    duration: '',
                    showTime: true,
                    constrainInput: false
                });
            });
            </script>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>Adinop Co., Ltd. was founded as an ingredients importer and local manufacturers’ distributor in 1986. We also function as an exporter of finished products</title>
        <link rel="stylesheet" href="../css/style.css"/>
    </head>
    <body>
        <div align="center">
            <fieldset>
                <legend class="nameTitle">ลงทะเบียนแจ้งซ่อมคอมพิวเตอร์</legend>
            <form  
                method="Post"
                action="serviceComSave.php"
                name ="frmMain" id="frmMain" OnSubmit="return CheckValidate();" />
            <table class="inputcontenttable"><br />
               
                <tr align="top">
                    <td>รหัสพนักงาน</td>
                    <td><input  id="txtEmpid" name="txtEmpid" type="text" value="<?= $objResult[emp_id] ?>" readonly/></td> 
                    <td width="50px"></td>
                    <td>ผู้แจ้ง</td>
                    <td><input id="txtNameEng" name="txtNameEng" type="text" value="<?= $objResult[emp_nameTh] ?>"readonly/></td>      
                </tr>
                <tr valign="top" >

                    <td>แผนกฝ่าย</td>
                    <td><input id="txtDepartment"  name="txtDepartment" type="text" value="<?= $objResult[departname] ?>" readonly/></td>  
                    <td width="50px"></td>
                    <td>รหัสเครื่อง</td>
                    <td><input id="txtNumber"  name="txtNumber" type="text" value="<?= $objResult[cn_number] ?>" readonly /></td>
                </tr>
                <tr valign="top" >
                    <td>อาการเสีย</td>
                    <td colspan="4"><textarea id="txtError" rows="4" cols="50" name="txtError" style="width: 445px"></textarea></td> 
                </tr>
                <tr valign="top" >
                </tr>
                <tr valign="top">
                    <td colspan="2"><input id="chkProgram" type="checkbox" name="chkProgram" value="Program">โปรแกรม</td>
                </tr>
                <tr valign="top">                  
                    <td colspan="2"><input id="Device" type="checkbox" name="chkDevice" value="Device">อุปกรณ์ต่อพ่วงและคอมพิวเตอร์</td>
                </tr>
                <tr>
                    <td colspan="5" align="center"><input  type="submit" name="Submit" value="Save" style="height: 30px; width: 120px" /></td>
                </tr>     
                <input type="hidden" name="alt_Id" value="<?= $objResult[alt_Id] ?>"/>
                <input type="hidden" name="id" value="<?= $objResult[id] ?>"/>
                <input type="hidden" name="cn_id" value="<?= $objResult[cn_id] ?>"/>
                <input type="hidden" name="mail" value="<?= $objResult[mail_coth] ?>"/>
                </form>
            </table>
            </fieldset>
        </div>
    </body>
</html>
